package cn.itsource.zcn.user.controller;

import cn.itsource.zcn.user.domain.Wxuser;
import cn.itsource.zcn.user.service.IWxuserService;
import cn.itsource.zcn.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;


/**
 * (Wxuser)表控制层
 *
 * @author makejava
 * @since 2021-08-20 22:10:30
 */
@RestController
@RequestMapping("/wechat")
public class WxuserController {
    /**
     * 服务对象
     */
    @Autowired
    private IWxuserService tWxuserService;

    /**
     * 查询全部数据
     *
     * @return List<>
     */
    @RequestMapping("/all")
    public List<Wxuser> queryAll() {
        return tWxuserService.queryAll();
    }

    @PostMapping("/login")
    public AjaxResult wxLogin(@RequestBody Map<String,String> map){
        return tWxuserService.login(map);
    }

    @PostMapping("/bind")
    public AjaxResult wxBind(@RequestBody Map<String,String> map){
        return tWxuserService.bind(map);
    }


}
